<!--考勤管理页-->
<template>
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <span style="line-height:60px;font-size:20px;">考勤统计</span>
    <span style="line-height:60px;font-size:20px;padding-left: 20px;">考勤明细</span>
  </div>
  <!-- 考勤搜索卡片 -->
  <el-card style="margin:20px;height: 70px;">
    <el-form :inline="true">
      <el-form-item label="月份筛选">
        <el-select v-model="selectedMonth" placeholder="请选择月份"style="width: 220px;">
          <el-option
              v-for="(month, index) in months"
              :key="index"
              :label="month"
              :value="index + 1"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="考勤组选择">
        <el-select placeholder="请选择" style="width: 150px;" v-model="searchSumForm.groupName">
          <el-option label="第一组" value="1"></el-option>
          <el-option label="第二组" value="2"></el-option>
          <el-option label="第三组" value="3"></el-option>
          <el-option label="第四组" value="4"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="部门筛选">
        <el-select placeholder="请选择" style="width: 150px;" v-model="searchSumForm.department">
          <el-option label="第一组" value="1"></el-option>
          <el-option label="第二组" value="2"></el-option>
          <el-option label="第三组" value="3"></el-option>
          <el-option label="第四组" value="4"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button @click="resetSearch">重置</el-button>
        <el-button type="primary" @click="loadCheckingSum">查询</el-button>
      </el-form-item>
      <el-form-item label="搜索：">
        <el-input placeholder="请输入姓名" style="width:220px;" v-model="searchSumForm.userName"></el-input>
      </el-form-item>
      <el-form-item style="padding-left: 70px;">
        <el-button  >导出</el-button>
      </el-form-item>
    </el-form>
  </el-card>
  <!-- 考勤列表 -->
  <el-card style="margin:20px;">
    <el-table :data="CheckingSumArr">
      <el-table-column type="index" label="姓名" width="80" align="center"/>
      <el-table-column prop="brand" label="考勤组" align="center"/>
      <el-table-column prop="license" label="组织部门" align="center"/>
      <el-table-column prop="code" label="出勤天数" align="center"/>
      <el-table-column prop="type" label="迟到次数" align="center"/>
      <el-table-column prop="price" label="缺勤次数" align="center"/>
      <el-table-column prop="buyTime" label="请假次数" align="center"/>
      <el-table-column prop="regTime" label="外勤次数" align="center"/>
      <el-table-column prop="regTime" label="居家办公" align="center"/>
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button link type="primary" size="small" @click="editCheckingSum(scope.row.id)">编辑</el-button>
          <el-button link type="primary" size="small" @click="deleteCheckingSum(scope.row.id)">删除</el-button>

        </template>
      </el-table-column>



    </el-table>
  </el-card>
</template>
<script setup>
import {onMounted, ref} from "vue";
//定义对象用来收集搜索卡片表单的数据
const searchSumForm = ref({
  userName: '',//用户名
  groupName: '',//考勤组名称
  department: '',//部门名称
});
const months = [
  '一月', '二月', '三月', '四月', '五月', '六月',
  '七月', '八月', '九月', '十月', '十一月', '十二月'
]
const selectedMonth = ref('')
//定义搜索卡片重置按钮的功能 清空值+重新加载车辆
const resetSearch = ()=>{
  searchSumForm.value = {};
  loadCheckingSum();
}
const loadCheckingSum = ()=>{

}
//定义数组用来保存组织表格数据
const CheckingSumArr = ref([]);
//定义编辑职位管理的方法
const editCheckingSum = (id)=>{

}
//定义删除指定职位管理的方法
const deleteCheckingSum = (id)=>{

}
//onMounted() VUE的生命周期钩子 在DOM渲染完毕后立即执行
onMounted(()=>{
  loadCheckingSum();
})


</script>